#include "Test.h"
#include <iostream>
using namespace std;
Test::Test(){
        a = 0;
        b = 0;
}

Test::Test(int a, int b){
        this->a = a;
        this->b = b;
}

Test::~Test(){
}

Test Test:: TestAdd(Test &t2){
        Test tmp(this->a+t2.a, this->b+t2.b );
        return tmp;
}

//返回一个引用 相当于返回自身
//返回t1这个元素 this就是&t1
Test& Test:: TestAdd2(Test &t2){
        this->a = this->a + t2.a;
        this->b = this->b + t2.b;
        
        return *this;
}

void Test::print(){
        cout<<"a = "<<a<<" b = "<<b<<endl;
}